package hjw.com.service;

import hjw.com.dao.CartMapper;
import hjw.com.entity.Cart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>Project:Academic - CartServiceImpl
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/2/17 15:49
 * @since 1.8
 */
@Service
public class CartServiceImpl implements CartService{
    private final CartMapper cartMapper;

    @Autowired
    public CartServiceImpl(CartMapper cartMapper) {
        this.cartMapper = cartMapper;
    }

    @Override
    public int addCart(Cart cart) {
        return cartMapper.addCart(cart);
    }

    @Override
    public int deleteCart(Cart cart) {
        return cartMapper.deleteCart(cart);
    }

    @Override
    public List<Cart> findCart(Map<String, Object> cartMap) {
        return cartMapper.findCart(cartMap);
    }

    @Override
    public int updateCart(Map<String, Object> map) {
        return cartMapper.updateCart(map);
    }
}
